const app = getApp();
const AJAX = app.$ajax,
  $wx = app.$wx;

Page({
  data: {
    imgHost: app.imgHost,
    orderStatus: {
      10: {
        text: '待评价'
      },

      20: {
        text: '已评价'
      },
    }
  },

  onLoad(options){
  },

  onShow(){
    this.getOrderList();
  },

  onShareAppMessage(){

  },

  getOrderList(params = {}) {
    AJAX.orderList({
      loadType: 'bar',
      status: 4
    }).then(([status, res, msg]) => {
      if (status) {
        this.setData({
          orderList: res,
          noData: res.length === 0 ? true : false
        });
      } else {
        $wx.showToast(msg);
        this.setData({
          noData: true
        });
      }
    });
  },
});